-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
meta: upgrade to next.js 16 #8218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8218 +/- ##
==========================================
- Coverage 76.77% 75.33% -1.44%
==========================================
Files 118 118
Lines 9828 9836 +8
Branches 336 332 -4
==========================================
- Hits 7545 7410 -135
- Misses 2281 2424 +143
Partials 2 2 ☔ View full report in Codecov by Sentry. |
|
cc @styfle any idea what the prod build failing could be? Pretty much using standard error pages 🤔 |
|
Hi, I haven't fully sorted this out, but I managed to get a "bad" passing build. This was my only attempt and the order of steps was a bit chaotic, so not as linearly as presented here. I used the With that flag I started to see: Error occurred prerendering page "/_not-found". Read more: https://nextjs.org/docs/messages/prerender-error
@node-core/website:build: Error:
@node-core/website:build: at WithNavBar (turbopack:///[project]/apps/site/components/withNavBar.tsx:43:31)
@node-core/website:build: 41 | const { resolvedTheme, setTheme } = useTheme();
@node-core/website:build: 42 | const { replace } = useRouter();
@node-core/website:build: > 43 | const pathname = usePathname();
@node-core/website:build: | ^All of the errors reported, pointed at the group of
After replacing the helpers with their const websitePages = await getMarkdownFiles(
process.cwd(),
`_pages/${defaultLocale.code}`
);With all of that...
I think the path generation is somehow causing all of these to error. At this point, I do not think that we need to change Also I am not familiar enough with this repo, so maybe I am building with the wrong Note that https://github.com/amannn/next-intl/tree/main/examples/example-app-router w/ next@beta builds without errors too. Hopefully this gives you some insight. Happy to keep on helping! |
Sounds like a bug on Next.js imo
Could be that |
|
Most likely a Next.js thing yeah ~ I'll try to set some time apart later, to try and build by bisecting canaries. |
|
Hey @ovflowd, thanks for pinging me! So yes, as @icyJoseph mentioned, the examples in the The only change I found in Next.js 16 beta that broke something for me was related to parallel routes (see vercel/next.js#84738), but a potential solution was discussed in that thread. I'll make a note to take a closer look at this PR tomorrow, maybe I can spot something! I'll keep you posted. |
|
Hello again! Could someone verify this, I've been doing some canary bisecting and such, and figured out a couple of things. Building with Building with Edit: I am confident I've found the source of the bug, I just don't understand |
|
@amannn sorry for the tag mate, but the mystery is nearly solved. The If we can sort this one out, then |
|
Got the solution :)
Then |
We are always happy to bug test dependencies 😃, betas are important! Thank you! |
Weird thing is Turbopack builds were working with Next.js 15 🤔 |
|
I also found something interesting when creating a Something is clearly bugged/borked on Next.js |
Right, in one of the canaries going up to v16, a Turbopack optimization was introduced, where some Pages Router assets are no longer generated, if there's no Pages Router code. How "no Pages Router code" is calculated has a bad branch. Hopefully a patch will be out soon 🙏 |
|
I was able to make it work with a very interesting work around. Creating a 404.tsx and 500.tsx, which kinda explains what you just said. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the Next.js framework from version 15.5.4 to 16.0.0-beta.0, bringing support for React 19 and introducing the React Compiler. The upgrade includes configuration changes to support new features and fixes for build issues.
Key changes:
- Upgraded Next.js to version 16.0.0-beta.0 with React Compiler enabled
- Added placeholder error pages (404.tsx and 500.tsx) and updated error handling components
- Migrated from Turbo to Turbopack for build optimization and updated TypeScript JSX configuration
Reviewed Changes
Copilot reviewed 13 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Updated @types/react version for React 19 compatibility |
| package.json | Updated cross-env and globals dependencies |
| apps/site/tsconfig.json | Changed JSX transform and added dev types path |
| apps/site/pages/500.tsx | Added placeholder 500 error page |
| apps/site/pages/404.tsx | Added placeholder 404 error page |
| apps/site/package.json | Upgraded Next.js and related packages, added React Compiler |
| apps/site/next.config.mjs | Enabled React Compiler and Turbopack configurations |
| apps/site/mdx/plugins.mjs | Optimized Shiki plugin as singleton for performance |
| apps/site/eslint.config.js | Updated ESLint Next.js configuration format |
| apps/site/app/global-error.tsx | Removed global error page component |
| apps/site/app/[locale]/not-found.tsx | Converted to server component and simplified UI |
| apps/site/app/[locale]/error.tsx | Simplified error page UI and removed arrow icon |
| .prettierignore | Added next-env.d.ts to ignore list |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Lighthouse Results
|
|
(Although this is just a workaround and it also creates a /500 and /404 route that are empty pages LOL) |
|
@ovflowd we have an open draft PR to fix it - getting it ready is next on the list! 🙏 |
|
Fix is merged: vercel/next.js#84873 - I verified by installing Next.js built using the commit when this PR got merged, and this branch builds without the 400/500 pages patch. It should be available in the next patch, 16.0.2 (16.0.1 went out before this got merged) |
|
Awesome! I'll keep an eye on 16.0.2, what's the ETA for it? Be released next week? |
fbe195e to
da1f03f
Compare
|
This can get merged. Eventually we can move to proxy.ts once this gets resolved upstream: vercel/next.js#86122 |
|
cc @nodejs/web-infra for a new review |
| { | ||
| "source": "/404", | ||
| "destination": "/" | ||
| }, | ||
| { | ||
| "source": "/500", | ||
| "destination": "/" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of having redirects on these error pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 13 out of 15 changed files in this pull request and generated 8 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "jsx": "preserve", | ||
| "jsx": "react-jsx", |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSX compiler option has been changed from "preserve" to "react-jsx". This change affects how JSX is transformed:
"preserve"keeps JSX as-is for Next.js to handle"react-jsx"uses the automatic JSX runtime
While "react-jsx" is generally correct for React 17+, Next.js typically expects "preserve" so it can handle JSX transformation itself. This might cause build issues or unexpected behavior. Verify this change is necessary for Next.js 16, or consider reverting to "preserve".
| "jsx": "react-jsx", | |
| "jsx": "preserve", |
| "mdast-util-to-string": "^4.0.0", | ||
| "next": "15.5.4", | ||
| "next-intl": "~4.3.11", | ||
| "next": "16.0.3", |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is upgrading to [email protected], which appears to be a beta version (the PR description shows "Next.js 16.0.0-beta.0" in the build output). Using beta versions in production is risky as they may contain bugs or breaking changes. Consider:
- Waiting for a stable Next.js 16 release
- Thoroughly testing all functionality with this beta version
- Documenting known issues and limitations
- Having a rollback plan ready
Note: The build error shown in the PR description (Error [PageNotFoundError]: Cannot find module for page: /_document) suggests there may be breaking changes in error page handling that need to be addressed.
| "next": "16.0.3", | |
| "next": "16.0.0", |
| { | ||
| "source": "/404", | ||
| "destination": "/" | ||
| }, | ||
| { | ||
| "source": "/500", | ||
| "destination": "/" | ||
| } |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding redirects for /404 and /500 to / may not be the correct solution for the build error mentioned in the PR description. These status codes are typically meant to display error pages, not redirect to the homepage. This could mask actual 404/500 errors in production. Consider instead:
- Keeping proper 404 and 500 error pages
- Investigating why Next.js 16 is having issues with the
_documentmodule - Checking if there are migration steps specific to error handling in Next.js 16
| { | |
| "source": "/404", | |
| "destination": "/" | |
| }, | |
| { | |
| "source": "/500", | |
| "destination": "/" | |
| } |
| // as we already check it on the CI within each Pull Request | ||
| // we also configure ESLint to run its lint checking on all files | ||
| eslint: { ignoreDuringBuilds: true }, | ||
| // Experimental Flags |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ESLint configuration section and its comment have been removed entirely. This removes the eslint: { ignoreDuringBuilds: true } setting. Without this, ESLint will now run during production builds, which may cause build failures if there are any linting errors. Consider either:
- Keeping
eslint: { ignoreDuringBuilds: true }if you still want to skip ESLint during builds - Ensuring all ESLint errors are fixed before merging
- Documenting this intentional change if the goal is to enforce linting during builds

This PR is a draft PR for upgrading to Next.js 16.